package com.breaker.kata.leetcode;

public class DeleteElement {

    public int removeElement(int[] nums, int val) {
        int start = 0;
        int index = 0;
        while (index < nums.length) {
            if (nums[index] == val) {
                nums[index] = 0;
            } else {
                nums[start] = nums[index];
                start++;
            }
            index++;
        }
        return start;
    }
}
